How we selected the Best Map

US Map Plot


My Points here

  • Point 1

  • Point 2

  • Point 3

Tab 3

Tab 3 Slide 1

Visuals here


Points here

Tab 3 Slide 2

Visuals Here


Points here

Tab 3 Slide 3

Visuals here


Points here

Tab 3 Slide 4

Visuals here


Points here

Conclusion

THANK YOU!!

Thank You


Our GitHub repo:

Our Rpubs link:

Shiny app link:

THANK YOU!!

---
title: "Foster Care Project Presentation"
output: 
  flexdashboard::flex_dashboard:
    source_code: embed
    theme: spacelab
    social: [ "twitter", "facebook", "menu" ]
---

```{r message=FALSE, warning=FALSE, include=FALSE}
library(flexdashboard)
library(readxl)
library(tidyverse)
library(viridis)
library(plotly)
library(sf)
library(leaflet)
```

```{r load-data-transformation}
#national dataset
nation_data<-read_excel("data/national_afcars_trends_2009_through_2018.xlsx",sheet="Data")

#State dataset
#Numbers of Children Served in Foster Care, by State
state_served <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="Served!A8:K60") %>%
gather(year,Served,'FY 2009':'FY 2018')

#Numbers of Children in Foster Care on September 30th, by State
state_inCare <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="In Care on September 30th!A8:K60") %>%
gather(year,InCare_Sep30,'FY 2009':'FY 2018')

#Numbers of Children Entering Foster Care, by State
state_entered <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="Entered!A8:K60") %>%
gather(year,Entered,'FY 2009':'FY 2018')

#Numbers of Children Exiting Foster Care, by State
state_exited <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="Exited!A8:K60") %>%
gather(year,Exited,'FY 2009':'FY 2018')

#Numbers of Children Waiting for Adoption, by State
state_waitingAdoption <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="Waiting for Adoption!A8:K60") %>%
gather(year,Waiting_Adoption,'FY 2009':'FY 2018')

#Numbers of Children Waiting for Adoption Whose Parental Rights Have Been Terminated, by State
state_parentalRightsTerminated <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="Parental Rights Terminated!A8:K60") %>%
gather(year,parental_rights_terminated,'FY 2009':'FY 2018')

#Numbers of Children Adopted, by State
state_adopted <- read_excel("data/afcars_state_data_tables_09thru18.xlsx",range="Adopted!A8:K60") %>%
gather(year,adopted,'FY 2009':'FY 2018')
```

```{r merge_data}
merge_cols<-c("State","year")
#The merge argument only takes two values as input, so you have to do them separately:
#state_df<- merge(state_served,state_inCare,state_entered,state_exited,state_waitingAdoption,state_parentalRightsTerminated,state_adopted,by=c("State","year"))

state_data<- merge(state_served,state_inCare,by=merge_cols)
state_data<- merge(state_data,state_entered,by=merge_cols)
state_data<- merge(state_data,state_exited,by=merge_cols)
state_data<- merge(state_data,state_waitingAdoption,by=merge_cols)
state_data<- merge(state_data,state_parentalRightsTerminated,by=merge_cols)
state_data<- merge(state_data,state_adopted,by=merge_cols)
```

```{r message=FALSE, warning=FALSE, include=FALSE}
us_states <- st_read("./shp/states.shp")
```

```{r}
state_data_2009 <- state_data %>% filter(year == 'FY 2009') %>% rename(STATE_NAME = State)
```

```{r message=FALSE, warning=FALSE}
us_states_mapped <- inner_join(us_states,state_data_2009,by="STATE_NAME")
```


How we selected the Best Map{.storyboard}
=========================================

### US Map Plot

```{r message=FALSE, warning=FALSE}

#Set hover text
us_states_mapped$hover <- with(us_states_mapped,paste(STATE_NAME,'
',"Served: ", Served)) # give state boundaries a white border l <- list(color = toRGB("white"), width = 2) # specify some map projection/options g6 <- list( scope = 'usa', projection = list(type = 'albers usa'), showlakes = TRUE, lakecolor = toRGB('white') ) g7 <- plot_geo(us_states_mapped, locationmode = 'USA-states') %>% add_trace( z = ~Served, text = ~hover, locations = ~STATE_ABBR, color = ~Served, colors = viridis_pal(option = "D")(3) ) %>% colorbar(title = "Served") %>% layout( title = 'Orphans Served by each state in 2009
(Hover for breakdown)', geo = g6 ) g7 ``` *** My Points here - Point 1 - Point 2 - Point 3 Tab 3 {.storyboard} ========================================= ### Tab 3 Slide 1 Visuals here *** Points here ### Tab 3 Slide 2 Visuals Here *** Points here ### Tab 3 Slide 3 Visuals here *** Points here ### Tab 3 Slide 4 Visuals here *** Points here Conclusion {.storyboard} ========================================= ### THANK YOU!! Thank You *** Our GitHub repo: Our Rpubs link: Shiny app link: THANK YOU!!